package com.qyer.search.report;/**
 * User: Z J Wu Date: 2016/01/07 Time: 20:46 Package: com.qyer.search.report
 */

import java.util.concurrent.LinkedBlockingQueue;

public class ReporterQueue {

  private static class InnerHolder {

    private static final ReporterQueue INSTANCE = new ReporterQueue();
  }

  private ReporterQueue() {
  }

  public static ReporterQueue getInstance() {
    return InnerHolder.INSTANCE;
  }

  private LinkedBlockingQueue<SearchReportItem> queue = new LinkedBlockingQueue<>();

  public void putToQueue(SearchReportItem sri) throws InterruptedException {
    this.queue.put(sri);
  }

  public SearchReportItem takeFromQueue() throws InterruptedException {
    return this.queue.take();
  }

}
